package com.snbc.Exception;

import java.math.BigDecimal;

/**
 * @Classname TestAccount
 * @Description TODO
 * @Date 2019/9/15 22:31
 * @Created by Acer
 */
public class TestAccount {

    public static void main(String[] args) {
        BigDecimal bd1 = new BigDecimal("0.00");
        Account account = new Account(bd1);
        //查询余额
        System.out.println("当前账户余额为：" + account.getBalance());
        //存款
        BigDecimal bd2 = new BigDecimal("10000.31");
        account.deposit(bd2);
        //取款
        BigDecimal bd3 = new BigDecimal("10000.30");
        try {
            account.withdraw(bd3);
        } catch (OverdraftException e) {
            e.printStackTrace();
        }
    }
}
